<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>充值详细信息</title>
<meta name="decorator" content="default" />
<style type="text/css">
</style>
<script type="text/javascript">
$().ready(function(){
disableExitMenu();
});
</script>
</head>

<body>
	<div data-role="navbar">
		<ul>
			<c:if test="${member.menuState.hasNewCards}">
				<li><a href="${ctx}/cash/member/shoppingDetails">新开卡消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasRecharges}">
				<li><a class="ui-btn-active" href="#">卡充值消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasProducts}">
				<li><a href="${ctx}/cash/member/shoppingDetails/product">购买产品消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasCares}">
				<li><a href="${ctx}/cash/member/shoppingDetails/docare">手工护理消费结算</a></li>
			</c:if>
			<c:if test="${member.menuState.hasGifts}">
				<li><a href="${ctx}/cash/member/shoppingDetails/gift">赠品</a></li>
			</c:if>
		</ul>
	</div>
	<div class="container">
		<tags:message content="${message}" />
		<h2 style="text-align: center;">确认结算方式</h2>
		<div class="icon-buttons">
			<a href="${ctx}/cash/member/detail?id=${member.customer.id}"
				data-role="button" data-inline="true" data-icon="back"
				data-iconpos="notext"> 返回</a> <a data-role="button"
				data-inline="true" data-icon="check" data-iconpos="notext"
				href="${ctx}/cash/member/shoppingPayment?id=${member.customer.id}">结算</a>
		</div>
		<div>
			<div>
				<div data-role="fieldcontain">
					<label><strong>总计充值费用(元)：</strong></label> <input id="totalMonney"
						type="text" readonly
						value="${member.rechargeEleMgr.payment.totalCost}" />
				</div>
				<ol>
					<c:if test="${member.rechargeEleMgr.payment.cashPay>0}">
						<li><strong>使用现金金支付: </strong>
							${member.rechargeEleMgr.payment.cashPay}</li>
					</c:if>
					<c:if test="${(member.rechargeEleMgr.payment.cardPay)>0}">
						<li><strong>使用综合充值卡支付: </strong>
							${member.rechargeEleMgr.payment.cardPay}</li>
					</c:if>
				</ol>
			</div>
		</div>
		<c:if test="${member.rechargeEleMgr.rechargedCardTimes[0]!=null}">
			<div>
				<table id="contentTableCardTimes" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="4" style="text-align:center;">计次护理卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>护理项目</th>
							<th>充值次数</th>
							<th>支付金额</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.rechargeEleMgr.rechargedCardTimes}"
							var="host">
							<tr>
								<c:forEach items="${host.recharges}" var="recharge">
									<td id="name">${host.cardDetail.name}</td>
									<td>${host.cardDetail.careName}</td>
									<td>${recharge.times}</td>
									<td>${recharge.money}</td>
								</c:forEach>
							</tr>
						</c:forEach>
						<tr class="warning">
							<td colspan="3">合计</td>
							<td>${member.rechargeEleMgr.payment.totalTimes}</td>
						</tr>
					</tbody>
				</table>
				<br /> <br />
			</div>
		</c:if>
		<c:if test="${member.rechargeEleMgr.rechargedCardDuration[0]!=null}">
			<div>
				<table id="contentTableCardDuration" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="4" style="text-align:center;">时段护理卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>护理项目</th>
							<th>充值时段</th>
							<th>支付金额</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.rechargeEleMgr.rechargedCardDuration}"
							var="host">
							<tr>
								<c:forEach items="${host.recharges}" var="recharge">
									<td id="name">${host.cardDetail.name}</td>
									<td>${host.cardDetail.careName}</td>
									<td>${recharge.duration}</td>
									<td>${recharge.money}</td>
								</c:forEach>
							</tr>
						</c:forEach>
						<tr class="warning">
							<td colspan="3">合计</td>
							<td>${member.rechargeEleMgr.payment.totalDuration}</td>
						</tr>

					</tbody>
				</table>
				<br /> <br />
			</div>
		</c:if>
		<c:if test="${member.rechargeEleMgr.rechargedCardProduct[0]!=null}">
			<div>
				<table id="contentTableCardProduct" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="5" style="text-align:center;">产品充值卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>适用产品</th>
							<th>产品折扣</th>
							<th>充值金额</th>
							<th>支付金额</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.rechargeEleMgr.rechargedCardProduct}"
							var="host">
							<tr>
								<c:forEach items="${host.recharges}" var="recharge">
									<td id="name">${host.cardDetail.name}</td>
									<td><c:forEach items="${host.cardDetail.products}"
											var="pro">
											<li>${pro}</li>
										</c:forEach></td>
									<td>${host.cardDetail.productDiscount}</td>
									<td>${recharge.rechargeMoney}</td>
									<td>${recharge.money}</td>
								</c:forEach>
							</tr>
						</c:forEach>
						<tr class="warning">
							<td colspan="3">合计</td>
							<td>${member.rechargeEleMgr.payment.totalProduct}</td>
						</tr>
					</tbody>
				</table>
				<br /> <br />
			</div>
		</c:if>
		<c:if test="${member.rechargeEleMgr.rechargedCardAll[0]!=null}">
			<div>
				<table id="contentTableCardAll" data-role="table"
					class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th colspan="5" style="text-align:center;">综合充值卡</th>
						</tr>
						<tr>
							<th>卡名</th>
							<th>产品折扣</th>
							<th>护理折扣</th>
							<th>充值金额</th>
							<th>支付金额</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${member.rechargeEleMgr.rechargedCardAll}"
							var="host">
							<tr>
								<c:forEach items="${host.recharges}" var="recharge">
									<td id="name">${host.cardDetail.name}</td>
									<td>${host.cardDetail.productDiscount}</td>
									<td>${host.cardDetail.careDiscount}</td>
									<td>${recharge.rechargeMoney}</td>
									<td>${recharge.money}</td>
								</c:forEach>
							</tr>
						</c:forEach>
						<tr class="warning">
							<td colspan="4">合计</td>
							<td>${member.rechargeEleMgr.payment.totalAll}</td>
						</tr>
					</tbody>
				</table>
				<br /> <br />
			</div>
		</c:if>
	</div>
</body>
</html>
